//
//  WSConcernTableViewCell.m
//  GroupFourFM
//
//  Created by dllo on 16/1/4.
//  Copyright © 2016年 GroupFour. All rights reserved.
//

#import "WSConcernTableViewCell.h"

@implementation WSConcernTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self){
        
        [self createSubs];
    }
    
    return self;
}

-(void)createSubs{
    
    self.authorPic = [[UIImageView alloc] init];
    [self.contentView addSubview:self.authorPic];
    self.authorPic.backgroundColor = [UIColor yellowColor];
    self.authorPic.layer.cornerRadius = (100-30)/2;
    self.authorPic.layer.masksToBounds = YES;
    [self.authorPic mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.top.mas_equalTo(@15);
        make.bottom.mas_equalTo(@-15);
        make.width.equalTo(self.contentView.mas_height).offset(-30);
        
    }];
    
    
    self.authorName = [[UILabel alloc] init];
    //self.authorName.backgroundColor = [UIColor blueColor];
    [self.contentView addSubview:self.authorName];
    
    [self.authorName mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.authorPic);
        make.left.equalTo(self.authorPic.mas_right).offset(15);
        make.height.mas_equalTo(@30);
        make.right.mas_equalTo(@-50);
        
    }];
    
    self.authorDescribe = [[UILabel alloc] init];
    //self.authorDescribe.backgroundColor = [UIColor purpleColor];
    [self.contentView addSubview:self.authorDescribe];
    self.authorDescribe.font = [UIFont systemFontOfSize:13];
    self.authorDescribe.textColor = [UIColor redColor];
    [self.authorDescribe mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.bottom.equalTo(self.authorPic);
        make.left.right.height.equalTo(self.authorName);
        
    }];
    
}

-(void)setAuthorM:(WSAuthorModel *)authorM{
    
    _authorM = authorM;
    
    [self.authorPic sd_setImageWithURL:[NSURL URLWithString:_authorM.largeLogo] placeholderImage:nil];
    self.authorName.text = _authorM.nickname;
    self.authorDescribe.text = _authorM.personDescribe;

}








- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
